<!DOCTYPE html>
<html>
    <head>
        <meta charset="utf-8">
        <title></title>
        <script src="../js/vue.js"></script>
    </head>
    <body>

        <script>
              Vue.config.productionTip = false;

              let data = {
                  name:"尚硅谷",
                  address:"西安"
              };

              function Observer(obj){
                  const keys = Object.keys(obj);
                  keys.forEach((k)=>{
                      Object.defineProperty(this,k,{
                          get(){
                              return obj[k];
                          },
                          set(val){
                            obj[k] = val;
                          }
                      });
                  });
              };

              const obs = new Observer(data);
              console.log(obs);
              const vm ={};
              vm._data= data = obs;

        </script>
    </body>
</html>